import 'package:safetymonitor/generated/json/base/json_field.dart';
import 'package:safetymonitor/generated/json/login_entity.g.dart';
import 'dart:convert';
export 'package:safetymonitor/generated/json/login_entity.g.dart';

@JsonSerializable()
class LoginEntity {
	late int userId = 0;
	late String accessToken = '';
	late String refreshToken = '';
	late int expiresTime = 0;
	late LoginCompanyInfo companyInfo;
	late List<LoginAppMenuCodes> appMenuCodes = [];

	LoginEntity();

	factory LoginEntity.fromJson(Map<String, dynamic> json) => $LoginEntityFromJson(json);

	Map<String, dynamic> toJson() => $LoginEntityToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}

@JsonSerializable()
class LoginCompanyInfo {
	late String companyCode = '';
	late int companyId = 0;
	late String companyName = '';
	late bool isHead = false;

	LoginCompanyInfo();

	factory LoginCompanyInfo.fromJson(Map<String, dynamic> json) => $LoginCompanyInfoFromJson(json);

	Map<String, dynamic> toJson() => $LoginCompanyInfoToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}

@JsonSerializable()
class LoginAppMenuCodes {
	late int createTime = 0;
	late int updateTime = 0;
	late String creator = '';
	late String updater = '';
	late bool deleted = false;
	late int id = 0;
	late String appMenuNameCode = '';
	late int roleId = 0;
	dynamic userId;
	dynamic roleOrUser;

	LoginAppMenuCodes();

	factory LoginAppMenuCodes.fromJson(Map<String, dynamic> json) => $LoginAppMenuCodesFromJson(json);

	Map<String, dynamic> toJson() => $LoginAppMenuCodesToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}